<?php
/**
 * Street Model
 *
 * PHP versions 4 and 5
 *
 * Infectamic: Free online role playing game, easily playable by browser. (http://infectamic.goldzoneweb.info)
 * Copyright 2011, Loic Chardonnet
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2011, Loic Chardonnet
 * @link          http://infectamic.goldzoneweb.info Infectamic
 * @package       cake
 * @subpackage    cake.cake.libs.controller
 * @since         CakePHP(tm) v 0.2.9
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
class Street extends AppModel {
	var $name = 'Street';
	var $displayField = 'id';
	var $validate = array(
		'town_id' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'You must select a town!',
				'allowEmpty' => false,
				'required' => true,
				'last' => false, // Stop validation after this rule
				'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'position' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'You must give a position!',
				'allowEmpty' => false,
				'required' => true,
				'last' => false, // Stop validation after this rule
				'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'numeric' => array(
				'rule' => array('notempty'),
				'message' => 'You must give an integer!',
				'allowEmpty' => false,
				'required' => true,
				'last' => false, // Stop validation after this rule
				'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'Town' => array(
			'className' => 'Town',
			'foreignKey' => 'town_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'user_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
}
?>